package com.sunbeam.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;

/**
 * @Title: ServiceUtils.java
 * @Package com.sunbeam.utils
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2014/02/11 13:29:06
 * @version V1.0
 */
public class ServiceUtils {

	/**
	 * 
	 * @Title: md5
	 * @Description: TODO
	 * @param @param message
	 * @param @return
	 * @return String
	 * @throws
	 */
	public static String md5(String message){
		try {
			MessageDigest md=MessageDigest.getInstance("md5");
			byte mdbytes[]=md.digest(message.getBytes());
			Base64 encoder=new Base64();
			return encoder.encode(mdbytes);
		} catch (NoSuchAlgorithmException e) {
			throw new RuntimeException(e);
		}
	}
}

